home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr50 / wbb13.zip / SAMPLE4.BAS < prev    next >
BASIC Source File  |  1993-06-04  |  3KB  |  157 lines

  1.  
  2.  
  3.  
  4. rem
  5. rem This program is a standard Basic program which does not utilize
  6. rem mouse, buttons, etc.  It shows how you can make Basic programs
  7. rem run under DOS with very few, if any, modifications.
  8. rem
  9. rem program prompts for $ amount, interest rate, and tax bracket.
  10. rem
  11. rem It displays before/after tax income for selected years.
  12. rem
  13.  
  14.  
  15. rem
  16. rem The following  WINDOWS SIZE command is optional.  This program will
  17. rem run in DOS and Windows without this command.  This command allows you
  18. rem to put items centered on DOS's 80x25 screen in a smaller window when
  19. rem running under Windows.
  20. rem You would do this if the DOS screen had columns on the left and/or
  21. rem rows on the top which were not used.  This lets you have a smaller
  22. rem window in Windows. 
  23.  
  24.     rem   WINDOWS SIZE 13,3,72,22
  25.  
  26.  
  27. rem
  28. rem The following WINDOWS NAME command is optional.  It allows you to
  29. rem specify the name to appear as window name when run under Windows.
  30. rem The default window name is the name of the file compiled.  This
  31. rem command is ignored in DOS mode.
  32. rem
  33.  
  34.     REM windows name "Investment Analysis"
  35.  
  36.  
  37.  
  38. color 7,1
  39. cls
  40.  
  41.  
  42.  
  43.    color 1,6
  44.    locate 3,22:print "Before/After tax investment analysis";
  45.    color 7,1
  46.    locate 5,22:print "Enter desired values and press Enter";
  47.    if ostype<>2 then
  48.      locate 6,22:print "    (Enter -9 to exit program)";
  49.   end if
  50.  
  51.    color 1,6
  52.    for y=12 to 21
  53.      locate y,15
  54.      print space$(50);
  55.    next y
  56.    locate 12,32:print "ACCOUNT BALANCE";
  57.    locate 14,29:print " Tax Free";
  58.    locate 14,49:print " Taxable";
  59.    locate 16,20:print "Year 1";
  60.    locate 18,20:print "Year 5";
  61.    locate 20,20:print "year 10";
  62.    color 7,1
  63.    di=6
  64.    dt=15
  65.    da=600
  66.  
  67. 100
  68.  
  69.    rem
  70.    rem get interest rate
  71.    rem
  72.    locate 8,20
  73.    print using "Enter Annual Interest Rate(##.##%):           ";di;
  74.    locate 8,56
  75.    input "",i
  76.    if i=-9 then stop
  77.    if i=0 then i=di else di=i
  78.    gosub doprojections
  79.  
  80.  
  81.    rem
  82.    rem get tax bracket
  83.    rem
  84.  
  85.    locate 9,20
  86.    print using "Enter Tax Bracket (##.##%):           ";dt;
  87.    locate 9,48
  88.    input "",t
  89.    if t=-9 then stop
  90.    if t=0 then t=dt else dt=t
  91.    gosub doprojections
  92.  
  93.  
  94.    rem
  95.    rem get investment amount
  96.    rem
  97.  
  98.    locate 10,20
  99.    print using "Enter Annual amount to invest ($##,###.##):             ";da;
  100.    locate 10,64
  101.    input "",a
  102.    if a=-9 then stop
  103.    if a=0 then a=da else da=a
  104.    gosub doprojections
  105.  
  106.    goto 100
  107.  
  108.  
  109.  
  110. rem
  111. rem calculation section which tells what we would have in the future
  112. rem
  113.  
  114. doprojections:
  115.  
  116.    color 1,6
  117.  
  118.    rem
  119.    rem calculate after tax contribution
  120.    rem
  121.        ba=(1-(dt/100))*da
  122.  
  123.    rem
  124.    rem calculate before tax effective interest earned
  125.    rem
  126.        bi=(1-(dt/100))*di
  127.  
  128.    rem
  129.    rem after year 1
  130.    rem
  131.  
  132.        before1=da*(1+di/100)
  133.        after1=ba*(1+bi/100)
  134.  
  135.    locate 16,30:print using "###,###.##";before1;
  136.    locate 16,50:print using "###,###.##";after1;
  137.  
  138.       for ii%=1 to 4
  139.     before1=(before1*(1+di/100))+(da*(1+di/100))
  140.     after1= (after1*(1+bi/100))+(ba*(1+bi/100))
  141.       next ii%
  142.  
  143.    locate 18,30:print using "###,###.##";before1;
  144.    locate 18,50:print using "###,###.##";after1;
  145.  
  146.  
  147.       for ii%=1 to 5
  148.     before1=(before1*(1+di/100))+(da*(1+di/100))
  149.     after1= (after1*(1+bi/100))+(ba*(1+bi/100))
  150.       next ii%
  151.  
  152.    locate 20,30:print using "###,###.##";before1;
  153.    locate 20,50:print using "###,###.##";after1;
  154.    color 7,1
  155.    return
  156.  
  157.